#include "chargeur_de_notes.h"
#include "son.h"
#include <algorithm>
#include <string>
#include <sstream>
#include <iostream>

namespace {
	struct supprimer {
		void operator()(son *p) {
			delete p;
		}
	};
}

chargeur_de_notes::chargeur_de_notes() throw(erreur) {
	for(int i=0; i<NB_TOUCHES_PIANO - 1; i++) {
		std::ostringstream oss;
		oss << "note" << i+1 << ".wav";
		mes_notes_.push_back(new son(oss.str()));
	}
}

chargeur_de_notes::~chargeur_de_notes() throw() {
	std::for_each(mes_notes_.begin(), mes_notes_.end(), supprimer());
}
